#@layoutT("查询代码")
#define main()
	#@formStart()
		#@queryStart('名称')
		   <input type="search" name="xName" autocomplete="off" class="layui-input" placeholder="名称"/>
		#@queryEnd()
	#@formEnd()
	
	 	<div class='layui-row f-index-toolbar'>
		<div class='layui-col-xs12'>
			<div class="layui-btn-group">
				<button id='addBtn_' class="layui-btn layui-btn-normal layui-btn-sm">
				  <i class="layui-icon">&#xe608;</i> 新增
				</button>
				<button id='refreshBtn_' class="layui-btn layui-btn-normal layui-btn-sm">
				  <i class="layui-icon">&#xe669;</i> 刷新
				</button>			
				<button id='deleteBtn_' class="layui-btn  layui-btn-normal layui-btn-sm">
				  <i class="layui-icon">&#xe640;</i> 删除
				</button>		
			</div>
		</div>
	</div>
	<div class="layui-row  f-index-toolbar">
			<div class="layui-col-xs12">
   				<table id="maingrid" lay-filter="maingrid"></table>
   			</div>
   	</div>
   	
   	<!-- 	每行的操作按钮 -->
	<script type="text/html" id="bar_maingrid">
  		<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  		<a class="layui-btn layui-btn-xs layui-btn-danger " lay-event="del">删除</a>
	</script>
#end

#define js()
<!-- 分页表格 -->
<script>
	/**
	 function userRole(obj){
		 var data=obj.data;
		var userCode=data.user_code;
		var userName=data.user_name;
		var url="#(path)/portal/core/sysUser/userRole?userCode="+userCode+"&userName="+userName;
		openDialog("配置用户角色",url,false,null,null);
	 }
	 **/

	gridArgs.title='查询';
	gridArgs.dataId='sID';
	gridArgs.deleteUrl='#(path)/portal/dbm/query/delete/';
	gridArgs.updateUrl='#(path)/portal/dbm/query/edit/';
	gridArgs.addUrl='#(path)/portal/dbm/query/add/';
	//gridArgs.resetUrl='#(path)/portal/core/sysUser/resetPassword';
	gridArgs.gridDivId ='maingrid';
	initGrid({id : 'maingrid'
			,elem : '#maingrid'
			,cellMinWidth: 80
			,cols : [ [
					{title: '主键',field : 'sID',width : 35,checkbox : true},						
					{title: 'ID', field: 'sID', width:70},
					{title: '名称', field: 'xName',width:160 },
        			{title: '路径', field: 'xPath',width:240},
					{title: '间隔', field: 'name',width:100},
					{title: '数据表', field: 'xTableName',width:160 },
					//{title: '类型', field: 'xType',width:100 ,templet:'#xtype'},
					{title: 'SQL语句', field: 'xText',width:200 },	
					{title: '创建时间', field: 'sCreateTime',width:180},
	        		{title: '最后修改', field: 'sLastUpdate',width:180},
	        		{title: '版本', field: 'sVersion',width:80},
	        		//{title: '性别', field: 'sex',templet:'#sexStr'},				
					{title: '操作',fixed:'right',width : 120,align : 'left',toolbar : '#bar_maingrid'} // 这里的toolbar值是模板元素的选择器
			] ]
			,url:"#(path)/portal/dbm/query/list"
			,searchForm : 'searchForm'
		});
	
</script>

#end


 
 
 